ShowItemSlot = inherit(Singleton)

function ShowItemSlot:constructor()
	-- Save them in a table, for later issues
	self.m_FontStrings = {}
	
	for key, value in ipairs(ShowItemSlot.EQUIPNUM) do
		self.m_FontStrings[#self.m_FontStrings+1] = self:createFontString(value.PARENT,key)
	end
end
	
function ShowItemSlot:createFontString(parent,key)

	local frame = CreateFrame("Frame",nil,_G[parent])
	frame:SetHeight(64)
	frame:SetWidth(64)
	frame.text = frame:CreateFontString(nil, "BACKGROUND", "PVPInfoTextFont")
	frame.text:SetVertexColor(1,1,0)
	frame.text:SetText(ShowItemSlot.EQUIPNUM[key].ID)
	frame.text:SetAllPoints()
	frame:SetPoint("CENTER",0,0)
	frame:Raise()
	frame:Hide()
	
	frame:SetScript("onEvent", bind(self.onModifier,self))
	frame:RegisterEvent("MODIFIER_STATE_CHANGED")

	return frame
end

function ShowItemSlot:onModifier(frame,event,button,state)
	if button == "LALT" then
		if state == 1 then
			frame:Show()
		else
			frame:Hide()
		end
	end
end

ShowItemSlot.EQUIPNUM = {
	{PARENT = "CharacterHeadSlot", 				ID = "1"}, 
	{PARENT = "CharacterShoulderSlot", 			ID = "3"},
	{PARENT = "CharacterBackSlot", 				ID = "15"},
	{PARENT = "CharacterChestSlot", 			ID = "5"},
	{PARENT = "CharacterShirtSlot", 			ID = "4"},
	{PARENT = "CharacterTabardSlot", 			ID = "19"},
	{PARENT = "CharacterWristSlot", 			ID = "9"},
	{PARENT = "CharacterMainHandSlot", 			ID = "16"},
	{PARENT = "CharacterSecondaryHandSlot", 	ID = "17"},
	{PARENT = "CharacterHandsSlot", 			ID = "10"},
	{PARENT = "CharacterWaistSlot", 			ID = "6"},
	{PARENT = "CharacterLegsSlot", 				ID = "7"},
	{PARENT = "CharacterFeetSlot", 				ID = "8"},
}